<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\AppendanceLogRep;
use Illuminate\Http\Request;

class AppendanceLog extends Controller
{
    //考勤
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new AppendanceLogRep();
    }

    /**
     * 获取考勤列表
     */
    public function getAppendanceLogList(Request $request){
        $params = $request->all();
        $data = $this->rep->getAppendanceLogListRep($params);
        return re(0,$data,'success');
    }

    /**
     * 考勤打卡
     */
    public function addAppendanceLog(Request $request){
        $params = $request->all();
        $data = $this->rep->addAppendanceLogRep($params);
        return re(0,$data,'success');
    }

    /**
     * 补考勤
     * @param Request $request
     */
    public function supplementAppendanceLog(Request $request){
        $params = $request->all();
        $data = $this->rep->supplementAppendanceLogRep($params);
        return re(0,$data,'success');
    }

    /**
     * 加班记录
     */
    public function getWorkOvertimeList(Request $request){
        $params = $request->all();
        $data = $this->rep->getWorkOvertimeListRep($params);
        return re(0,$data,'success');
    }
}
